package practice1;

import java.math.BigInteger;
import java.util.Scanner;

public class P1009 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt();
        BigInteger sum = new BigInteger("0");
        for(int i=1;i<=n;i++){
            BigInteger multi = new BigInteger("1");
            for(int j=1;j<=i;j++){
                multi = multi.multiply(BigInteger.valueOf(j));
            }
            sum = sum.add(multi);
        }
        System.out.println(sum);
    }
}
